import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';
import { registerMicroApps, start, setDefaultMountApp } from 'qiankun';
const apps = [
  {
    name: 'vue-project-zqf',//微应用package.json的name字段
    entry: 'http://localhost:8101',//微应用访问地址，默认加载这个html页面并解析其中的js动态执行
    container: '#container',//容器名
    activeRule: '/sub-vue',//激活路径，微应用路由
  },
  {
    name: 'react-project',
    entry: 'http://localhost:8102',
    container: '#container',
    activeRule: '/sub-react',
  },
]
registerMicroApps(apps, {
  beforeLoad: (app) => console.log('before load', app),
  beforeMount: [(app) => console.log('before mount', app.name)],
});

setDefaultMountApp('/sub-vue/about')

// 启动 qiankun
start();

Vue.config.productionTip = false;

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount('#app');
